<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
</head>
<body>
<div class="nav">
    <ul>
        <li>福利管理</li>
        <li>/</li>
        <li>添加福利</li>
    </ul>
</div>
<div>
    <form id="add">
        <p>
            <textarea style="width: 500px; height: 250px;" id="benefitDesc"></textarea>
        </p>
        <p class="btn-box">
            <input type="button" value="添加" onclick="benefitAdd()">
            <input type="reset" value="重置">
        </p>
    </form>
</div>
<script type="text/javascript">
    function benefitAdd() {
        var benefitDesc = $("#benefitDesc").val();
        $.post("/web/benefit", {op: "benefitSave", benefitDesc: benefitDesc}, function (data) {
            switch (data) {
                case "1":
                    $("#content").load("benefit/benefit-list.html");
                    alert("添加成功");
                    break;
                default:
                    $("#content").load("benefit/benefit-list.html");
                    alert("添加失败");
            }
        });
    }
</script>
</body>
</html>